package ufc.web.conexaoBD;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory {
	private static final String url = "jdbc:mysql://localhost/fasthot";
	//private static final String url = "jdbc:h2:~/bancoteste";
	private static final String usuario = "localhost";
	private static final String senha = "mysql";

	public static Connection getConnection(){
		Connection con = null;
		try{
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection(url, usuario, senha);
			System.out.println("Conexao com sucesso");
		}catch(ClassNotFoundException e){
			e.printStackTrace();
			System.out.println("Erro na conexao");
		}catch(SQLException e){
			e.printStackTrace();
		}
		return con;
	}

}
